﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>站点管理 </title>
    <link href="../static/css/admin.css?v=6" rel="stylesheet" />
    <script src="../static/js/boot.js?v=2"></script>
    <script src="../static/js/admin.js?v=2"></script>
    <style>

    </style>
    <script>
        var apiUrl = API_PATH + "/Site/";
        var keyValue = $.request("keyValue");
        var IsEdit = $.request("IsEdit");
        var selectValue = 0;
        var kty = 1;
        $(function () {
            initControl();
            console.log(keyValue);
            if (!!keyValue) {
                $.ajax({
                    url: apiUrl + "GetFormJson?keyId=" + keyValue,
                    dataType: "json",
                    async: false,
                    beforeSend: function (jqXHR) {
                        jqXHR.setRequestHeader("Authorization", 'Bearer ' + window.LS.get("lmgcmstoken"));
                    },
                    success: function (ret) {
                        $("#form1").formSerialize(ret);
                        if (ret.IsOpen == "1") {
                            $("#IsOpen").attr("checked", "checked");
                        }
                       
                    }
                });
            }
            if (IsEdit == "0") {
                //查看
                $("#btn_finish").attr("disabled", "disabled");
            }
        })
        function initControl() {

            $("#AddTime").val(new Date().Format('yyyy-MM-dd hh:mm:ss'));

        }

        function submitForm() {
            if (!$('#form1').formValid()) {
                return false;
            }
            var paramform = $("#form1").formSerialize();
            if (paramform["IsOpen"] == "true") {
                paramform["IsOpen"] = 1;
            } else {
                paramform["IsOpen"] = 0;
            }
            $.submitForm({
                url: apiUrl + "SubmitForm" ,
                param: paramform,
                paramType: true,
                success: function () {
                    $.currentWindow().$("#gridList").resetSelection();
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }
    </script>
</head>
<body style="margin:0px;padding:0px;overflow:hidden;">
    <form id="form1" class="form-inline" role="form" method="post">
        <input type="hidden" id="ID" name="ID" value="" />
        <input type="hidden" id="OrderBy" name="OrderBy" value="" />
        <input type="hidden" id="AddTime" name="AddTime" value="" />
        <div class="gridPanel">
            <ul id="myTab" class="nav nav-tabs">
                <li class="active"><a href="#app" data-toggle="tab">基本信息</a></li>
                <li><a href="#seo" data-toggle="tab">SEO</a></li>
                <li><a href="#smtp" data-toggle="tab">关闭网站</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="app">
                    <table class="form">
                        <tr>
                            <th class="formTitle">网站名称<span style="color:#ff0000">*</span></th>
                            <td class="formValue" colspan="3">
                                <input id="Name" name="Name" type="text" class="form-control required" autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">网站域名<span style="color:#ff0000">*</span></th>
                            <td class="formValue" colspan="3">
                                <input id="SiteUrl" name="SiteUrl" type="text" class="form-control required" autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">网站Logo<span style="color:#ff0000"></span></th>
                            <td class="formValue" colspan="3">
                                <input id="SiteLogo" name="SiteLogo" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">网站描述<span style="color:#ff0000"></span></th>
                            <td class="formValue" colspan="3">
                                <input id="Summary" name="Summary" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">电话<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="SiteTel" name="SiteTel" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                            <th class="formTitle">传真<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="SiteFax" name="SiteFax" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">邮箱<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="SiteEmail" name="SiteEmail" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                            <th class="formTitle">QQ<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="QQ" name="QQ" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">微信<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="WeiXin" name="WeiXin" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                            <th class="formTitle">微博<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="WeiBo" name="WeiBo" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">公司地址<span style="color:#ff0000"></span></th>
                            <td class="formValue" colspan="2">
                                <input id="SiteAddress" name="SiteAddress" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">网站备案号<span style="color:#ff0000"></span></th>
                            <td class="formValue" colspan="3">
                                <input id="SiteCode" name="SiteCode" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">版权信息<span style="color:#ff0000"></span></th>
                            <td class="formValue" colspan="3">
                                <input id="SiteCopyright" name="SiteCopyright" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="tab-pane fade" id="seo">
                    <table class="form">
                        <tr>
                            <th class="formTitle">SEO标题<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="SeoTitle" name="SeoTitle" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">SEO关键字<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="SeoKey" name="SeoKey" type="text" class="form-control " autocomplete="off" maxlength="200" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">SEO描述<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <textarea id="SeoDescribe" name="SeoDescribe" class="form-control" rows="13" style="width: 100%;"></textarea>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="tab-pane fade" id="smtp">
                    <table class="form">
                        <tr>
                            <th class="formTitle">关闭网站<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="IsOpen" name="IsOpen" type="checkbox" checked="checked" value="1" /><label for="IsOpen">启用</label>
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">关闭网站<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <input id="SiteDir" name="SiteDir" type="text"  value="Main" />
                            </td>
                        </tr>
                        <tr>
                            <th class="formTitle">关闭原因<span style="color:#ff0000"></span></th>
                            <td class="formValue">
                                <textarea id="CloseInfo" name="CloseInfo" class="form-control" rows="13" style="width: 100%;"></textarea>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </form>
</body>
</html>